using System;
using System.Drawing;
using System.IO;

namespace GetTogether.RichText.Converter.Image
{

	
	public class RtfImageConvertSettings
	{

		
		public RtfImageConvertSettings() :
			this( new RtfVisualImageAdapter() )
		{
		} // RtfImageConvertSettings

		
		public RtfImageConvertSettings( IRtfVisualImageAdapter imageAdapter )
		{
			if ( imageAdapter == null )
			{
				throw new ArgumentNullException( "imageAdapter" );
			}

			this.imageAdapter = imageAdapter;
		} // RtfImageConvertSettings

		
		public IRtfVisualImageAdapter ImageAdapter
		{
			get { return imageAdapter; }
		} // ImageAdapter

		
        private Color _BackgroundColor;

        public Color BackgroundColor
        {
            get { return _BackgroundColor; }
            set { _BackgroundColor = value; }
        }

		
		public string ImagesPath
		{
			get { return imagesPath; }
			set { imagesPath = value; }
		} // ImagesPath

		
		public bool ScaleImage
		{
			get { return scaleImage; }
			set { scaleImage = value; }
		} // ScaleImage

		
		//public float ScaleOffset { get; set; }
        private float _ScaleOffset;

        public float ScaleOffset
        {
            get { return _ScaleOffset; }
            set { _ScaleOffset = value; }
        }

		
		//public float ScaleExtension { get; set; }
        private float _ScaleExtension;

        public float ScaleExtension
        {
            get { return _ScaleExtension; }
            set { _ScaleExtension = value; }
        }

		
		public string GetImageFileName( int index, RtfVisualImageFormat rtfVisualImageFormat )
		{
			string imageFileName = imageAdapter.ResolveFileName( index, rtfVisualImageFormat );
			if ( !string.IsNullOrEmpty( imagesPath ) )
			{
				imageFileName = Path.Combine( imagesPath, imageFileName );
			}
			return imageFileName;
		} // GetImageFileName

		
		private readonly IRtfVisualImageAdapter imageAdapter;
		private string imagesPath;
		private bool scaleImage = true;
	} // class RtfImageConvertSettings

} 

